﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TecBaseObjects.Objects;
using TecTools.Controller;

namespace TecTools.Forms {

    public partial class OrganisationSearch : Form {

        #region Members

        private List<Organisation> myModel;
        private OrganisationSearchController controller;

        #endregion

        #region Constructor

        public OrganisationSearch() {
            
            this.controller = new OrganisationSearchController(this);
            InitializeComponent();
            this.rbName.Checked = true;
        }

        #endregion

        #region Properties

        public Organisation MyCurrentModel {
            get;
            set;
        }

        public List<Organisation> MyModel {
            get { return this.myModel; }
            set { this.myModel = value; }
        }

        #endregion

        #region Methods

        private void RBNameStrasseCheckedChanged(object sender, EventArgs e) {
            RadioButton rb = sender as RadioButton;
            if (rb.Name.Contains("Strasse")) {
                this.comboBox1.DisplayMember = "Strasse";
                this.comboBox1.Refresh();
            } else {
                this.comboBox1.DisplayMember = "Name";
                this.comboBox1.Refresh();
            }
        }

        private void ReloadData(object sender, EventArgs e) {
        }

        private void SetFormValues() {
            this.rbName.Checked = true;
            
        }

        #endregion

        #region Form Events
        #endregion

    }
}
